package org.jsola.contract.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.contract.dto.IssuedSealAddDTO;
import org.jsola.contract.dto.SealAddDTO;
import org.jsola.contract.dto.SealBatchDTO;
import org.jsola.contract.dto.SealUpdateDTO;
import org.jsola.contract.query.SealQuery;
import org.jsola.contract.vo.SealListVO;
import org.jsola.contract.vo.SealVO;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;

/**
 * 印章
 *
 * @author JanusMix
 */
@Api(tags = "contract-印章")
public interface ISealControllerAPI {

    /**
     * 新增印章
     *
     * @param sealAddDTO 印章新增实体
     * @return 印章展示对象
     */
    @ApiOperation(value = "新增印章")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sealAddDTO", dataType = "SealAddDTO", value = "新增印章", paramType = "body")
    })
    Result<SealVO> save(SealAddDTO sealAddDTO);


    /**
     * 修改印章
     *
     * @param sealUpdateDTO 印章
     * @return 更新数量
     */
    @ApiOperation(value = "修改印章")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sealUpdateDTO", dataType = "SealUpdateDTO", value = "修改印章", paramType = "body")
    })
    Result<Integer> update(SealUpdateDTO sealUpdateDTO);

    /**
     * 批量编辑、新增、删除印章
     *
     * @param sealBatchDTO 要操作的印章
     * @return 操作之后的全部印章
     */
    @ApiOperation(value = "批量编辑、新增、删除印章")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sealBatchDTO", dataType = "SealBatchDTO", value = "要操作的字段数据", paramType = "body")
    })
    Result batch(SealBatchDTO sealBatchDTO);


    /**
     * 删除单个印章，彻底删除
     *
     * @param sealId 印章id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个印章，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sealId", dataType = "Long", value = "印章id", paramType = "path")
    })
    Result<Integer> delete(Long sealId);


    /**
     * 批量删除印章，彻底删除
     *
     * @param sealIds 印章id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除印章，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sealIds", dataType = "Long[]", value = "印章id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(Long[] sealIds);


    /**
     * 根据印章id查询印章详情
     *
     * @param sealId 印章id
     * @return 印章详情
     */
    @ApiOperation(value = "根据印章id查询印章详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sealId", dataType = "Long", value = "印章id", paramType = "path")
    })
    Result<SealVO> findById(Long sealId);


    /**
     * 查询印章
     *
     * @param sealQuery 印章查询参数
     * @return page
     */
    @ApiOperation(value = "查询印章")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sealQuery", dataType = "SealQuery", value = "印章查询参数", paramType = "query")
    })
    Result<List<SealListVO>> listAll(SealQuery sealQuery);


    /**
     * 分页查询印章
     *
     * @param sealQuery 印章查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询印章")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sealQuery", dataType = "SealQuery", value = "印章查询参数", paramType = "query")
    })
    Result<Page<SealListVO>> page(SealQuery sealQuery);

    /**
     * 下发印章到公司
     *
     * @param issuedSealAddDTO 印章
     * @return 印章
     */
    @ApiOperation(value = "下发印章到公司")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "issuedSealAddDTO", dataType = "IssuedSealAddDTO", value = "印章", paramType = "body")
    })
    Result<List<SealVO>> saveIssuedSeal(IssuedSealAddDTO issuedSealAddDTO);
}

